package group.rober.saber.kit;

import java.util.Map;
import java.util.Stack;

public abstract class ClassKit {
    public static Stack<ClassLoader> getClassLoaderStack(Class<?> startClass){
        Stack<ClassLoader> stack = new Stack<ClassLoader>();
        if(startClass != null){
            ClassLoader classLoader = startClass.getClassLoader();
            while(classLoader!=null){
                stack.push(classLoader);
                classLoader = classLoader.getParent();
            }
        }
        return stack;
    }

    public static boolean isAssignableFrom(Class<?> parentClassType,Class<?> childClassType){
        return parentClassType.isAssignableFrom(childClassType);
    }
}
